]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
StIcon: use g_signal_connect_object() for safety
authorGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 27 Mar 2013 16:54:41 +0000 (17:54 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 28 Apr 2013 22:19:59 +0000 (00:19 +0200)
Prevent a crash in case an icon is destroyed before the texture
finishes loading, and something else is keeping the texture alive
for any reason.

https://bugzilla.gnome.org/show_bug.cgi?id=696720

src/st/st-icon.c

index 4d149e1c12c3888aad2aeea270bc547c64672fbf..b29744b64139e3fdab08a79d117460a80e478eda 100644 (file)
@@ -410,8 +410,8 @@ st_icon_finish_update (StIcon *icon)
       st_icon_update_shadow_material (icon);
 
       /* "pixbuf-change" is actually a misnomer for "texture-changed" */
-      g_signal_connect (priv->icon_texture, "pixbuf-change",
-                        G_CALLBACK (on_pixbuf_changed), icon);
+      g_signal_connect_object (priv->icon_texture, "pixbuf-change",
+                               G_CALLBACK (on_pixbuf_changed), icon, 0);
     }
 }
 
@@ -469,7 +469,7 @@ st_icon_update (StIcon *icon)
       else
         {
           /* Will be shown when fully loaded */
-          priv->opacity_handler_id = g_signal_connect (priv->pending_texture, "notify::opacity", G_CALLBACK (opacity_changed_cb), icon);
+          priv->opacity_handler_id = g_signal_connect_object (priv->pending_texture, "notify::opacity", G_CALLBACK (opacity_changed_cb), icon, 0);
         }
     }
   else if (priv->icon_texture)